﻿#pragma once

#include "Layer.h"

namespace Hazal
{
	/// <summary>
	/// Layer stack, 由Applicaition管理, 用以进行layer的分配
	/// </summary>
	class HZ_DLL_OPTION CLayerStack
	{
	public:
		CLayerStack();

		~CLayerStack(); 


	public:
		void PushLayer(CLayer* layer);

		void PushOverlay(CLayer* overlay);

		void PopLayer(CLayer* layer);

		void PopOverlay(CLayer* overlay);

	public:
		using LayerVec = std::vector<CLayer*>;
		using LayerVecIter = std::vector<CLayer*>::iterator;
		using LayerReVecIter = std::vector<CLayer*>::reverse_iterator;


	public:
		LayerVecIter begin() { return m_vecLayers.begin(); }

		LayerVecIter end() { return m_vecLayers.end(); }

		LayerReVecIter rbegin() { return m_vecLayers.rbegin(); }

		LayerReVecIter rend() { return m_vecLayers.rend(); }

	private:
		LayerVec m_vecLayers;
		unsigned int m_unLayerInsertIdx;
	};
}
